.\"   $Id: rflattenphfig.3,v 1.1 2002/03/08 13:51:04 fred Exp $
.\" @(#)rflattenphfig.2 2.11 91/08/22 ; Labo masi cao-vlsi; Author : Frederic Petrot
.if t \{\
.so man1/alc_contents.mac
.XS \n%
.ti 0.2i
rflattenphfig
.XE
.XS1 \n%
.ti 0.2i
rflattenphfig
.XE1 \}
.TH RFLATTENPHFIG 3 "October 1, 1997" "ASIM/LIP6" "MBK PHYSICAL UTILITY FUNCTIONS"
.SH NAME
rflattenphfig \- recursivly flatten a figure 
.so man1/alc_origin.1
.SH SYNOPSIS
.nf
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
#include "mph.h"
void rflattenphfig(ptfig, concat, catal)
phfig_list \(**ptfig;
char concat;
char catal;
.ft R
.fi
.SH PARAMETERS
.TP 20
\fIptfig\fP
Pointer to a physical figure
.TP
\fIconcat\fP
Name generation mode
.TP
\fIcatal\fP
End level choice
.SH DESCRIPTION
\fBrflattenphfig\fP recursivly flattens all the instances of the figure
pointed to by \fIptfig\fP. 
.br
The \fIconcat\fP argument can take either the value \fBYES\fP in which case the
name of the objects coming from instances are named
\fIinsname'X'objectname\fP, where \fI'X'\fP is the caracter set int the
\fBMBK_SEPAR\fP(1) environment variable, or the value \fBNO\fP, and then the
object name remains inchanged. This is quite dangerous since name unicity is
no more warrantied, and may cause the flatten to fail. See \fBMBK_SEPAR\fP(1),
\fBmbkenv\fP(3) and \fBconcatname\fP(3) for details.
.br
The \fIcatal\fP argument may be set to \fBNO\fP, in which case flattening stops
at the transistor level, all hierachies and instances have desapeard, only
terminal elements remains. If set to \fBYES\fP, flattening stops when it
encounters an instance model being present in the catalog file, set by
the \fBMBK_CATAL_NAME\fP(1) environment variable. See \fBMBK_CATAL_NAME\fP(1) and
\fBincatalog\fP(3) for details.
.SH ERRORS
No errors can directly result from a call to \fBrflattenphfig\fP, but since it
uses many other mbk functions, it may be a good error starting point.
.SH EXAMPLE
.ta 3n 6n 9n 12n 15n 18n 21n
.nf
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
#include "mph.h"
void flatten_my_amd2901()
{
phins_list \(**pt;
	pt = getphfig("my_amd2901", 'A');
	rflattenphfig(pt, YES, YES);
	pt\->NAME = "my_flattened_amd2901";
	savephfig(pt);
}
.ft R
.fi
.SH SEE ALSO
.BR mbk (1),
.BR incatalog (3),
.BR mbkenv (3),
.BR phfig (3),
.BR addphfig (3),
.BR getphfig (3),
.BR delphfig (3),
.BR loadphfig (3),
.BR savephfig (3),
.BR flattenphfig (3),
.BR MBK_CATAL_NAME (1).


.so man1/alc_bug_report.1

